/**
 * @file   test2.cpp
 * @author Kimmo Luoma <kimmo@PHOTON3>
 * @date   Wed Oct 10 10:28:07 2012
 * 
 * @brief  Simple test where shift has incompatiple dimensions
 * 
 * 
 */

#include "coin.hpp"
#include "shift.hpp"
#include "state.hpp"
#include<boost/math/constants/constants.hpp>


int main(){
  
  /**
   * RING
   * 
   */

  int N=9;
  int d=2;
  int T=100;
  
  /**
   * STATE
   * 
   */
  matrix<std::complex<double> > psi(d,N,0);
  psi(0,0)=1/std::sqrt(2);
  psi(1,0)=std::complex<double>(0,1/std::sqrt(2));

  state<std::complex<double> > s(psi);
  
  /**
   * DFT COIN
   * 
   */

  std::complex<double> I(0,1);
  const double pi=boost::math::constants::pi<double>();
  matrix<std::complex<double> > H(d,d);
  for(int k=0;k < d; k++){
    for(int l=0; l < d; l++){
      H(k,l)=std::exp(2*pi*I*k*l/d);
    }
  }
  H=H*(1/std::sqrt(d));
  
  coin<std::complex<double > > CH(H);

  /**
   * Shift operator
   * 
   */
  matrix<std::complex<double> > p1(N+1,N+1,0),p2(N+1,N+1,0);
  for(int k=0;k<N+1;k++){
    p1((k+1) % (N+1),k)=1;
    p2(k,(k+1) % (N+1))=1;
  }
  shift<std::complex<double> > S;
  S.add_op(0,p1);
  S.add_op(1,p2);

  s*=S;

  return 0;
}
